import request from '@/utils/request'

export default {
	typeQuery: (data, isLoading = true) => { //获取商品分类列表
		return request({
			url: '/system/mall/product/type/query',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	syncType: (data, isLoading = true) => { //同步商品分类
		return request({
			url: '/system/mall/product/type/syncType',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	updState: (data, isLoading = true) => { //商品分类状态修改
		return request({
			url: '/system/mall/product/type/updState',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	supplier: (data, isLoading = true) => { //供应商列表
		return request({
			url: '/system/mall/supplier',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	syncSupplier: (data, isLoading = true) => { //同步供应商
		return request({
			url: '/system/mall/supplier/syncSupplier',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	
	getSupplierData: (data, isLoading = true) => { //获取供应商下拉框数据
		return request({
			url: '/system/mall/supplier/getSupplierData',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	getTypes: (data, isLoading = true) => { //获取商品父类型数据
		return request({
			url: '/system/mall/product/type/getTypes',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	getTypeByPid: (data, isLoading = true) => { //获取商品子分类数据
		return request({
			url: '/system/mall/product/type/getTypeByPid',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	goodsQuery: (data, isLoading = true) => { //商品列表
		return request({
			url: '/system/wuyeinfo/mall/product/query',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	goodsDel: (data, isLoading = true) => { // 商品删除
		return request({
			url: '/system/wuyeinfo/mall/product/del',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	syncProduct: (data, isLoading = true) => { //同步商品
		return request({
			url: '/system/wuyeinfo/mall/product/syncProduct',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	updOnlineState: (data, isLoading = true) => { //商品单/批量上下架
		return request({
			url: '/system/wuyeinfo/mall/product/updOnlineState',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

	getMonographics: (data, isLoading = true) => { // 获取商品专题数据
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/getMonographics',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	getMonographicProduct: (data, isLoading = true) => { // 获取专题商品
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/getMonographicProduct',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	updProductSort: (data, isLoading = true) => { // 更新专题商品排序
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/updProductSort',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	delMainMonographic: (data, isLoading = true) => { // 删除主专题
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/delMainMonographic',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	delSubMonographic: (data, isLoading = true) => { // 删除子专题
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/delSubMonographic',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	delProductRel: (data, isLoading = true) => { // 删除专题商品关联
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/delProductRel',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	saveUpdMonographic: (data, isLoading = true) => { // 添加修改专题
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/saveUpdMonographic',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	getSelProduct: (data, isLoading = true) => { // 获取可选择的专题商品数据
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/getSelProduct',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},
	addMonographicProducts: (data, isLoading = true) => { // 添加专题商品
		return request({
			url: '/system/wuyeinfo/mall/product/monographic/addMonographicProducts',
			method: 'post',
			params: data,
			loading: isLoading,
		})
	},

}
